object Demo {
  def main(args: Array[String]): Unit = {

    val arr = Array("e1","e2","e3","e8","e2","e6","e8","e2")

    val i = arr.lastIndexOf("e8")

    val strings = arr.slice(0, i+1)

    println(strings.mkString(":"))


  }

}
